﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using HAUtil;

namespace HA.ModFlow.Application
{

    /// <summary>
    /// 应用程序配置信息存储类
    /// </summary>
    [Serializable]
   public  class ModflowSettingInfo:SettingInfo
    {

        public ModflowSettingInfo()
        {

           
 
        }



        string _defaultLayoutString;

        public string DefaultLayoutString
        {
            get { return _defaultLayoutString; }
            set { _defaultLayoutString = value; }
        }


        //string _userSpecLayoutString;

        //public string UserSpecLayoutString
        //{
        //    get { return _userSpecLayoutString; }
        //    set { _userSpecLayoutString = value; }
        //}


        List<History> _recentFile = new List<History>();

        public List<History> RecentFile
        {
            get { return _recentFile; }
            set { _recentFile = value; }
        }


        public void AddHistory(History h)
        {


            ///默认我们只取6条最近的项目
            History old;
            if ((old = this._recentFile.FirstOrDefault<History>(his => his.FilePath == h.FilePath)) != null)
            {
                _recentFile.Remove(old);
                _recentFile.Add(h);


            }
            else
            {

                if (this._recentFile.Count == 10)
                {
                    _recentFile.RemoveAt(0);
                    _recentFile.Add(h);
                }
                else
                {
                    _recentFile.Add(h);
                }

            }


        }
      






    }
}
